<!-- 普通二级目录组件 -->

<template>
  <a-sub-menu :key="valueMap.name">
    <template #icon> <component :is="valueMap.meta.icon"></component></template>
    <template #title>{{ valueMap.meta.title }}</template>
    <template v-for="(v, i) in valueMap.children" :key="i">
      <deskMenuItem :data="v" />
    </template>
  </a-sub-menu>
</template>

<script lang="ts">
import { toRefs } from 'vue';
import deskMenuItem from '../deskMenuItem/deskMenuItem.vue';
import importConfigFunction from './deskSubMenu';
export default {
  components: {
    deskMenuItem,
  },
  props: {
    data: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  setup(props: any) {
    const { base, init } = importConfigFunction(props);
    init();
    return {
      ...toRefs(base),
    };
  },
};
</script>

<style></style>
